using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using DevExpress.XtraReports.Parameters;

namespace TireService.Web.Reports.Design
{
    public partial class ServiceCarSchedule : DevExpress.XtraReports.UI.XtraReport
    {
        public ServiceCarSchedule()
        {
            InitializeComponent();
        }

        private void xrSubreport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            //TaskDetailReport repTaskDetailReport = new TaskDetailReport();

            //Parameter param1 = new Parameter();

            //param1.Name = "TaskId";
            
            //// Specify other parameter properties.
            //param1.Type = typeof(System.Int32);
            //param1.Value = Convert.ToInt32(lblTaskId.Text);
            //param1.Description = "TaskId: ";
            //param1.Visible = false;

            //// Add the parameter to the report.
            //repTaskDetailReport.Parameters.Add(param1);

            //// Specify the report's filter string.
            //repTaskDetailReport.FilterString = "[TaskId] = [Parameters.TaskId]";

            try
            {
                int taskid = Convert.ToInt32(lblTaskId.Text);

                TaskDetailReport s1 = new TaskDetailReport();
                s1.TaskId = taskid;
                XRSubreport sub1 = (XRSubreport)sender;
                sub1.ReportSource = s1;
            }
            catch (Exception)
            {
                XRSubreport sub1 = (XRSubreport)sender;
                sub1.Visible = false;
            }

            
        }

    }
}
